package com.ck.ckcloud.powerenvironment.core.enums;

import lombok.Getter;

import java.util.Arrays;

/**
 * 管理类型枚举
 */
@Getter
public enum ManageStatusEnum {

	IN_MANAGEMENT(0,"管理中"),

	UN_MANAGEMENT(1,"未管理")

	;

	private Integer code;

	private String message;

	ManageStatusEnum(Integer code, String message) {
		this.code = code;
		this.message = message;
	}

	/**
	 * 根据管理类型获取文本
	 * @param managetype
	 * @return
	 */
	public static String getManageStatus(Integer managetype){
		return Arrays.asList(ManageStatusEnum.values()).stream()
			.filter(m -> m.getCode().equals(managetype))
			.findFirst().orElse(ManageStatusEnum.UN_MANAGEMENT).getMessage();
	}


}
